'''
Created on 2009-10-22

@author: summit
'''
from Cheetah.Template import Template
from Ft.Xml import InputSource, CreateInputSource
from Ft.Xml.Domlette import NonvalidatingReader
import  Ft.Xml.Domlette
from Ft.Xml.XPath.Context import Context
from Ft.Xml.XPath import Evaluate

def make_template():
    t = Template(file="tvtkwrap.tmpl")
    t.import_lib = ""
    t.class_label = "PythonViewImage"
    t.class_docs = ""
    t.wrap_class = "vtkPythonViewImage"
    t.class_traist = []
    t.class_constructor = ""
    t.class_init = ""
    
    t.class_property = []
    t.class_view = ""
    t.view=""
    
    return t
    
    
if __name__ == '__main__':
    isrc = CreateInputSource("vtkPythonViewImage.xml")
    doc = Ft.Xml.Domlette.NonvalidatingReader.parse(isrc)
    Ft.Xml.Domlette.Print(doc)
    print make_template()
    nodes = Evaluate(u'//traits', contextNode=doc)
    
    for n in nodes:
        print n.attributes
        print n.attributes[(None,'name')].value
        

